package com.squid.templateProject.utils;

import cn.hutool.core.date.DateUtil;

import java.util.Calendar;
import java.util.Date;

/**
 * Description
 *
 * @author jinhang
 * @since 2024-1-24
 **/
public class TimeUtils {
    private static final String DEFAULT_PATTERN = "yyyy-MM-dd HH:mm:ss";

    /**
     * 获取现在的时间
     *
     * @return 字符串
     */
    public static String getCurrentTime() {
        Date date = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return DateUtil.format(calendar.getTime(), DEFAULT_PATTERN);
    }
}
